<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加试题 - 试题库管理系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <!-- Tailwind 配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36CBCB',
                        accent: '#FF7D00',
                        success: '#00B42A',
                        warning: '#FF7D00',
                        danger: '#F53F3F',
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-hide {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .question-card-hover {
                @apply transition-all duration-300 hover:shadow-md hover:border-primary/30;
            }
            .fade-in {
                animation: fadeIn 0.5s ease-in-out;
            }
            @keyframes fadeIn {
                from { opacity: 0; transform: translateY(10px); }
                to { opacity: 1; transform: translateY(0); }
            }
        }
    </style>
</head>
<body class="bg-gray-50 font-inter text-gray-800 min-h-screen flex flex-col">
    <!-- 顶部导航栏 -->
    <header class="bg-white shadow-sm sticky top-0 z-50 transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center space-x-2">
                <button id="sidebar-toggle" class="lg:hidden text-gray-500 hover:text-primary transition-colors">
                    <i class="fa fa-bars text-xl"></i>
                </button>
                <h1 class="text-xl font-bold text-primary flex items-center">
                    <i class="fa fa-book mr-2"></i>
                    <span>试题库管理系统</span>
                </h1>
            </div>
            
            <div class="hidden md:flex items-center space-x-6">
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">首页</a>
                <a href="#" class="text-primary font-medium border-b-2 border-primary pb-1">题库</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">教材版本</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">统计分析</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">系统设置</a>
            </div>
            
            <div class="flex items-center space-x-4">
                <div class="relative">
                    <input type="text" placeholder="搜索试题、知识点..." 
                           class="pl-10 pr-4 py-2 rounded-full bg-gray-100 focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all w-40 lg:w-64">
                    <i class="fa fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
                </div>
                
                <div class="relative">
                    <button class="text-gray-500 hover:text-primary transition-colors">
                        <i class="fa fa-bell text-xl"></i>
                        <span class="absolute -top-1 -right-1 bg-danger text-white text-xs rounded-full h-4 w-4 flex items-center justify-center">3</span>
                    </button>
                </div>
                
                <div class="flex items-center space-x-2 cursor-pointer group">
                    <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-transparent group-hover:border-primary transition-all">
                    <span class="hidden md:inline font-medium">张老师</span>
                    <i class="fa fa-angle-down text-gray-400 group-hover:text-primary transition-colors"></i>
                </div>
            </div>
        </div>
    </header>

    <div class="flex flex-1 overflow-hidden">
        <!-- 左侧边栏 - 知识点导航 -->
        <aside id="sidebar" class="w-64 bg-white shadow-md transform -translate-x-full lg:translate-x-0 fixed lg:static h-full z-40 transition-transform duration-300 ease-in-out overflow-y-auto scrollbar-hide">
            <div class="p-4 border-b">
                <div class="flex items-center justify-between mb-3">
                    <h2 class="font-bold text-lg">知识点导航</h2>
                    <div class="relative">
                        <select class="appearance-none bg-gray-100 rounded-lg px-3 py-1 pr-8 focus:outline-none focus:ring-1 focus:ring-primary">
                            <option>全部学科</option>
                            <option selected>数学</option>
                            <option>物理</option>
                            <option>化学</option>
                            <option>生物</option>
                        </select>
                        <i class="fa fa-chevron-down absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 pointer-events-none"></i>
                    </div>
                </div>
                
                <div class="relative">
                    <input type="text" placeholder="搜索知识点..." 
                           class="w-full pl-8 pr-4 py-2 rounded-lg bg-gray-100 focus:outline-none focus:ring-1 focus:ring-primary">
                    <i class="fa fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
                </div>
            </div>
            
            <!-- 教材版本选择 -->
            <div class="p-4 border-b">
                <h3 class="font-medium text-sm text-gray-500 mb-2">选择教材版本</h3>
                <div class="space-y-2">
                    <div class="relative">
                        <select class="w-full appearance-none bg-gray-100 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-1 focus:ring-primary">
                            <option selected>人教版 2023版</option>
                            <option>苏教版 2022版</option>
                            <option>北师大版 2023版</option>
                            <option>沪科版 2024版</option>
                        </select>
                        <i class="fa fa-chevron-down absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 pointer-events-none"></i>
                    </div>
                </div>
            </div>
            
            <!-- 知识点树形导航 -->
            <div class="p-4">
                <div class="flex items-center justify-between mb-3">
                    <h3 class="font-medium text-sm text-gray-500">知识点结构</h3>
                    <div class="flex space-x-1">
                        <button id="expand-all" class="text-xs text-gray-500 hover:text-primary">展开</button>
                        <span class="text-gray-300">|</span>
                        <button id="collapse-all" class="text-xs text-gray-500 hover:text-primary">收起</button>
                    </div>
                </div>
                
                <div class="space-y-1">
                    <!-- 章节1 -->
                    <div class="chapter-item">
                        <div class="flex items-center justify-between cursor-pointer hover:bg-gray-50 rounded-lg p-2 transition-colors">
                            <div class="flex items-center">
                                <i class="fa fa-book text-primary mr-2"></i>
                                <span class="font-medium">第一章 集合与常用逻辑用语</span>
                            </div>
                            <i class="fa fa-angle-down text-gray-400 transition-transform"></i>
                        </div>
                        
                        <div class="pl-6 mt-1 space-y-1">
                            <div class="section-item">
                                <div class="flex items-center justify-between cursor-pointer hover:bg-gray-50 rounded-lg p-2 transition-colors">
                                    <div class="flex items-center">
                                        <i class="fa fa-bookmark-o text-secondary mr-2"></i>
                                        <span>1.1 集合的含义与表示</span>
                                    </div>
                                    <span class="text-xs bg-blue-100 text-blue-600 px-2 py-0.5 rounded-full">32题</span>
                                </div>
                                
                                <div class="pl-6 mt-1 space-y-1">
                                    <div class="knowledge-item bg-primary/5 border-l-2 border-primary p-2 rounded-r-lg cursor-pointer hover:bg-primary/10 transition-colors">
                                        <div class="flex items-center justify-between">
                                            <div class="flex items-center">
                                                <i class="fa fa-dot-circle-o text-primary mr-2"></i>
                                                <span>集合的定义</span>
                                            </div>
                                            <span class="text-xs text-gray-500">3题</span>
                                        </div>
                                    </div>
                                    
                                    <div class="knowledge-item hover:bg-gray-50 p-2 rounded-lg cursor-pointer transition-colors">
                                        <div class="flex items-center justify-between">
                                            <div class="flex items-center">
                                                <i class="fa fa-dot-circle-o text-gray-400 mr-2"></i>
                                                <span>集合的表示方法</span>
                                            </div>
                                            <span class="text-xs text-gray-500">5题</span>
                                        </div>
                                    </div>
                                    
                                    <div class="knowledge-item hover:bg-gray-50 p-2 rounded-lg cursor-pointer transition-colors">
                                        <div class="flex items-center justify-between">
                                            <div class="flex items-center">
                                                <i class="fa fa-dot-circle-o text-gray-400 mr-2"></i>
                                                <span>元素与集合的关系</span>
                                            </div>
                                            <span class="text-xs text-gray-500">4题</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="section-item">
                                <div class="flex items-center justify-between cursor-pointer hover:bg-gray-50 rounded-lg p-2 transition-colors">
                                    <div class="flex items-center">
                                        <i class="fa fa-bookmark-o text-secondary mr-2"></i>
                                        <span>1.2 集合间的基本关系</span>
                                    </div>
                                    <span class="text-xs bg-blue-100 text-blue-600 px-2 py-0.5 rounded-full">24题</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 章节2 -->
                    <div class="chapter-item">
                        <div class="flex items-center justify-between cursor-pointer hover:bg-gray-50 rounded-lg p-2 transition-colors">
                            <div class="flex items-center">
                                <i class="fa fa-book text-primary mr-2"></i>
                                <span>第二章 一元二次函数、方程和不等式</span>
                            </div>
                            <i class="fa fa-angle-right text-gray-400 transition-transform"></i>
                        </div>
                    </div>
                    
                    <!-- 章节3 -->
                    <div class="chapter-item">
                        <div class="flex items-center justify-between cursor-pointer hover:bg-gray-50 rounded-lg p-2 transition-colors">
                            <div class="flex items-center">
                                <i class="fa fa-book text-primary mr-2"></i>
                                <span>第三章 函数概念与性质</span>
                            </div>
                            <i class="fa fa-angle-right text-gray-400 transition-transform"></i>
                        </div>
                    </div>
                    
                    <!-- 章节4 -->
                    <div class="chapter-item">
                        <div class="flex items-center justify-between cursor-pointer hover:bg-gray-50 rounded-lg p-2 transition-colors">
                            <div class="flex items-center">
                                <i class="fa fa-book text-primary mr-2"></i>
                                <span>第四章 指数函数与对数函数</span>
                            </div>
                            <i class="fa fa-angle-right text-gray-400 transition-transform"></i>
                        </div>
                    </div>
                </div>
            </div>
        </aside>
        
        <!-- 主内容区 -->
        <main class="flex-1 overflow-y-auto bg-gray-50 p-4 lg:p-6">
            <div class="container mx-auto">
                <!-- 面包屑导航 -->
                <div class="flex items-center text-sm text-gray-500 mb-4">
                    <a href="#" class="hover:text-primary">首页</a>
                    <i class="fa fa-angle-right mx-2 text-gray-300"></i>
                    <a href="#" class="hover:text-primary">题库</a>
                    <i class="fa fa-angle-right mx-2 text-gray-300"></i>
                    <a href="#" class="hover:text-primary">数学题库</a>
                    <i class="fa fa-angle-right mx-2 text-gray-300"></i>
                    <a href="#" class="hover:text-primary">集合的定义</a>
                    <i class="fa fa-angle-right mx-2 text-gray-300"></i>
                    <span class="text-primary font-medium">添加试题</span>
                </div>
                
                <!-- 内容标题区 -->
                <div class="flex flex-col md:flex-row md:items-center justify-between mb-6">
                    <div>
                        <h2 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-gray-800">添加试题</h2>
                        <p class="text-gray-500 mt-1">请填写以下信息创建新试题</p>
                    </div>
                    
                    <div class="flex space-x-3 mt-4 md:mt-0">
                        <button id="cancel-btn" class="bg-white border border-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 transition-colors flex items-center">
                            <i class="fa fa-times mr-2"></i> 取消
                        </button>
                        <button id="save-question-btn" class="bg-primary text-white px-4 py-2 rounded-lg hover:bg-primary/90 transition-colors flex items-center">
                            <i class="fa fa-save mr-2"></i> 保存试题
                        </button>
                    </div>
                </div>
                
                <!-- 试题表单 -->
                <div class="bg-white rounded-xl shadow-sm p-6 mb-6 fade-in">
                    <form id="question-form">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">学科</label>
                                <select class="w-full appearance-none bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary">
                                    <option>数学</option>
                                    <option>物理</option>
                                    <option>化学</option>
                                    <option>生物</option>
                                    <option>语文</option>
                                    <option>英语</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">教材版本</label>
                                <select class="w-full appearance-none bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary">
                                    <option>人教版 2023版</option>
                                    <option>苏教版 2022版</option>
                                    <option>北师大版 2023版</option>
                                    <option>沪科版 2024版</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">章节</label>
                                <select class="w-full appearance-none bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary">
                                    <option>第一章 集合与常用逻辑用语</option>
                                    <option>第二章 一元二次函数、方程和不等式</option>
                                    <option>第三章 函数概念与性质</option>
                                    <option>第四章 指数函数与对数函数</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">知识点</label>
                                <select class="w-full appearance-none bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary">
                                    <option>集合的定义</option>
                                    <option>集合的表示方法</option>
                                    <option>元素与集合的关系</option>
                                    <option>集合间的基本关系</option>
                                    <option>集合的运算</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">题型</label>
                                <select class="w-full appearance-none bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" id="question-type">
                                    <option value="single">单选题</option>
                                    <option value="multiple">多选题</option>
                                    <option value="judge">判断题</option>
                                    <option value="fill">填空题</option>
                                    <option value="answer">解答题</option>
                                    <option value="proof">证明题</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">难度</label>
                                <select class="w-full appearance-none bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary">
                                    <option>简单</option>
                                    <option>中等</option>
                                    <option>困难</option>
                                </select>
                            </div>
                        </div>
                        
                        <div class="mb-6">
                            <label class="block text-sm font-medium text-gray-700 mb-1">题干</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <button class="text-gray-400 hover:text-gray-600">
                                        <i class="fa fa-bold"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-italic"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-underline"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-link"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-image"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-code"></i>
                                    </button>
                                </div>
                                <textarea class="w-full pl-28 pr-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary min-h-[120px]" placeholder="请输入试题题干..."></textarea>
                            </div>
                        </div>
                        
                        <!-- 选项区域 - 根据题型动态显示/隐藏 -->
                        <div id="options-container" class="mb-6">
                            <label class="block text-sm font-medium text-gray-700 mb-3">选项</label>
                            
                            <div class="space-y-3">
                                <div class="flex items-center">
                                    <span class="inline-block w-6 h-6 rounded-full bg-gray-100 flex items-center justify-center mr-2">A</span>
                                    <input type="text" class="flex-1 p-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" placeholder="选项内容">
                                    <div class="ml-2 flex items-center">
                                        <label class="inline-flex items-center cursor-pointer">
                                            <input type="radio" name="correct-answer" class="form-radio text-primary focus:ring-primary h-4 w-4">
                                            <span class="ml-2 text-sm text-gray-700">正确</span>
                                        </label>
                                    </div>
                                </div>
                                
                                <div class="flex items-center">
                                    <span class="inline-block w-6 h-6 rounded-full bg-gray-100 flex items-center justify-center mr-2">B</span>
                                    <input type="text" class="flex-1 p-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" placeholder="选项内容">
                                    <div class="ml-2 flex items-center">
                                        <label class="inline-flex items-center cursor-pointer">
                                            <input type="radio" name="correct-answer" class="form-radio text-primary focus:ring-primary h-4 w-4">
                                            <span class="ml-2 text-sm text-gray-700">正确</span>
                                        </label>
                                    </div>
                                </div>
                                
                                <div class="flex items-center">
                                    <span class="inline-block w-6 h-6 rounded-full bg-gray-100 flex items-center justify-center mr-2">C</span>
                                    <input type="text" class="flex-1 p-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" placeholder="选项内容">
                                    <div class="ml-2 flex items-center">
                                        <label class="inline-flex items-center cursor-pointer">
                                            <input type="radio" name="correct-answer" class="form-radio text-primary focus:ring-primary h-4 w-4">
                                            <span class="ml-2 text-sm text-gray-700">正确</span>
                                        </label>
                                    </div>
                                </div>
                                
                                <div class="flex items-center">
                                    <span class="inline-block w-6 h-6 rounded-full bg-gray-100 flex items-center justify-center mr-2">D</span>
                                    <input type="text" class="flex-1 p-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" placeholder="选项内容">
                                    <div class="ml-2 flex items-center">
                                        <label class="inline-flex items-center cursor-pointer">
                                            <input type="radio" name="correct-answer" class="form-radio text-primary focus:ring-primary h-4 w-4">
                                            <span class="ml-2 text-sm text-gray-700">正确</span>
                                        </label>
                                    </div>
                                </div>
                                
                                <div class="flex justify-end">
                                    <button type="button" class="text-primary hover:text-primary/80 text-sm flex items-center">
                                        <i class="fa fa-plus-circle mr-1"></i> 添加选项
                                    </button>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 填空题答案区域 -->
                        <div id="fill-answer-container" class="mb-6 hidden">
                            <label class="block text-sm font-medium text-gray-700 mb-3">参考答案（用逗号分隔多个答案）</label>
                            <input type="text" class="w-full p-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" placeholder="例如：1,2,3">
                        </div>
                        
                        <!-- 解答题/证明题答案区域 -->
                        <div id="long-answer-container" class="mb-6 hidden">
                            <label class="block text-sm font-medium text-gray-700 mb-1">参考答案</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <button class="text-gray-400 hover:text-gray-600">
                                        <i class="fa fa-bold"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-italic"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-underline"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-link"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-image"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-code"></i>
                                    </button>
                                </div>
                                <textarea class="w-full pl-28 pr-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary min-h-[150px]" placeholder="请输入参考答案..."></textarea>
                            </div>
                        </div>
                        
                        <!-- 判断题选项 -->
                        <div id="judge-options-container" class="mb-6 hidden">
                            <label class="block text-sm font-medium text-gray-700 mb-3">参考答案</label>
                            <div class="flex space-x-4">
                                <label class="inline-flex items-center cursor-pointer">
                                    <input type="radio" name="judge-answer" value="true" class="form-radio text-primary focus:ring-primary h-4 w-4">
                                    <span class="ml-2 text-sm text-gray-700">正确</span>
                                </label>
                                <label class="inline-flex items-center cursor-pointer">
                                    <input type="radio" name="judge-answer" value="false" class="form-radio text-primary focus:ring-primary h-4 w-4">
                                    <span class="ml-2 text-sm text-gray-700">错误</span>
                                </label>
                            </div>
                        </div>
                        
                        <div class="mb-6">
                            <label class="block text-sm font-medium text-gray-700 mb-1">解析</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <button class="text-gray-400 hover:text-gray-600">
                                        <i class="fa fa-bold"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-italic"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-underline"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-link"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-image"></i>
                                    </button>
                                    <button class="text-gray-400 hover:text-gray-600 ml-2">
                                        <i class="fa fa-code"></i>
                                    </button>
                                </div>
                                <textarea class="w-full pl-28 pr-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary min-h-[100px]" placeholder="请输入试题解析..."></textarea>
                            </div>
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">分值</label>
                                <input type="number" class="w-full p-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" placeholder="请输入分值" min="1" max="100" value="5">
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">来源</label>
                                <input type="text" class="w-full p-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary" placeholder="请输入试题来源，如：课本、练习册等">
                            </div>
                        </div>
                        
                        <div class="flex items-start mb-6">
                            <div class="flex items-center h-5">
                                <input id="is-public" type="checkbox" class="focus:ring-primary h-4 w-4 text-primary border-gray-300 rounded">
                            </div>
                            <div class="ml-3 text-sm">
                                <label for="is-public" class="text-gray-700">设为公开试题，允许其他教师查看和使用</label>
                            </div>
                        </div>
                        
                        <div class="flex items-start mb-6">
                            <div class="flex items-center h-5">
                                <input id="is-important" type="checkbox" class="focus:ring-primary h-4 w-4 text-primary border-gray-300 rounded">
                            </div>
                            <div class="ml-3 text-sm">
                                <label for="is-important" class="text-gray-700">标记为重点试题</label>
                            </div>
                        </div>
                    </form>
                </div>
                
                <!-- 操作按钮 -->
                <div class="flex justify-end space-x-3">
                    <button id="cancel-btn-bottom" class="bg-white border border-gray-300 text-gray-700 px-6 py-3 rounded-lg hover:bg-gray-50 transition-colors">
                        取消
                    </button>
                    <button id="save-question-btn-bottom" class="bg-primary text-white px-6 py-3 rounded-lg hover:bg-primary/90 transition-colors flex items-center">
                        <i class="fa fa-save mr-2"></i> 保存试题
                    </button>
                </div>
            </div>
        </main>
    </div>
    
    <!-- 成功提示模态框 -->
    <div id="success-modal" class="fixed inset-0 bg-black bg-opacity-50 z-50 hidden flex items-center justify-center">
        <div class="bg-white rounded-xl shadow-lg p-6 max-w-md w-full transform transition-all duration-300 scale-95 opacity-0" id="success-modal-content">
            <div class="text-center">
                <div class="inline-flex items-center justify-center w-16 h-16 rounded-full bg-green-100 text-green-600 mb-4">
                    <i class="fa fa-check text-2xl"></i>
                </div>
                <h3 class="text-xl font-bold text-gray-900 mb-2">试题添加成功</h3>
                <p class="text-gray-600 mb-6">试题已成功添加到题库中，是否继续添加新试题？</p>
                <div class="flex justify-center space-x-3">
                    <button id="continue-adding" class="bg-white border border-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 transition-colors">
                        继续添加
                    </button>
                    <button id="back-to-list" class="bg-primary text-white px-4 py-2 rounded-lg hover:bg-primary/90 transition-colors">
                        返回列表
                    </button>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 题型切换逻辑
        document.getElementById('question-type').addEventListener('change', function() {
            const type = this.value;
            const optionsContainer = document.getElementById('options-container');
            const fillAnswerContainer = document.getElementById('fill-answer-container');
            const longAnswerContainer = document.getElementById('long-answer-container');
            const judgeOptionsContainer = document.getElementById('judge-options-container');
            